package com.vegetable.modules.entity.baseData;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品分类实体类
 * </p>
 *
 * @author wangruijie
 * @since 2024-12-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("product_category")
@ApiModel(value = "ProductCategory对象", description = "商品分类")
public class ProductCategory implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("分类名称")
    @TableField("category_name")
    private String categoryName;

    @ApiModelProperty("分类编码")
    @TableField("category_code")
    private String categoryCode;

    @ApiModelProperty("父分类ID，0表示顶级分类")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty("分类层级：1顶级，2二级，3三级")
    @TableField("level")
    private Integer level;

    @ApiModelProperty("排序字段")
    @TableField("sort_order")
    private Integer sortOrder;

    @ApiModelProperty("分类图标")
    @TableField("icon")
    private String icon;

    @ApiModelProperty("分类描述")
    @TableField("description")
    private String description;

    @ApiModelProperty("是否启用：0否1是")
    @TableField("is_enabled")
    private Integer isEnabled;

    @ApiModelProperty("创建者ID")
    @TableField("create_user_id")
    private Long createUserId;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新者ID")
    @TableField("update_user_id")
    private Long updateUserId;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}